package com.yami.utils;

import java.net.URLDecoder;
import java.util.Map;

public class DecodeToUTF8 {
	public static void decodeToutf8(Map map, String str) {
		String[] strs = str.split("&|=");
		String key = "";
		String value = "";
		for (int i = 0; i < strs.length; i += 2) {
			System.out.println(strs[i] + ":" + strs[i + 1]);
			try {
				key = URLDecoder.decode(strs[i], "utf-8");
				value=URLDecoder.decode(strs[i + 1], "utf-8");
				System.out.println(key + ":" + value);
			map.put(key, value);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
